<template>
  <div>
    <h1>父组件</h1>
    <comp-son></comp-son>
    <button @click="color = 'red'">red</button>
    <button @click="color = 'blue'">blue</button>
  </div>
</template>

<script>
import { provide, ref } from "@vue/composition-api";
import son from "./son";

export default {
  components: {
    "comp-son": son
  },
  setup() {
    const color = ref("red");
    provide("themeColor", color);
    return {
      color
    };
  }
};
</script>

<style scoped></style>
